package com.huffman.smart_picture.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.huffman.smart_picture.common.UserSession;
import com.huffman.smart_picture.common.base.reponse.PageQueryResult;
import com.huffman.smart_picture.domain.entity.Picture;
import com.huffman.smart_picture.domain.request.picture.*;
import com.huffman.smart_picture.domain.vo.pircture.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
* @author LinDeng
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-02-16 16:08:07
*/
public interface PictureService extends IService<Picture> {
    /**
     * 图片上传
     * @param inputSource
     * @param pictureUploadRequest
     * @param userSession
     * @return
     */
    PictureVo uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, UserSession userSession);

    /**
     * 管理员批量导入文件
     * @param pictureUploadByBatchRequest
     * @param userSession
     * @return
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, UserSession userSession);

    /**
     * 根据id查询图片信息
     * @param id
     * @param userSession
     * @return
     */
    PictureDetailVo getPictureDetail(Long id, UserSession userSession);

    /**
     * 根据id删除图片
     * @param id
     * @param userSession
     * @return
     */
    boolean deletePicture(Long id, UserSession userSession);

    /**
     * 保存更新图片
     * @param pictureUpdateRequest
     * @param userSession
     */
    void saveOrUpdatePicture(PictureUpdateRequest pictureUpdateRequest, UserSession userSession);

    /**
     * 分页查询公共图片
     * @param picturePageQueryRequest
     * @return
     */
    PageQueryResult<PictureViewVo> pageQueryByAdmin(PicturePageQueryRequest picturePageQueryRequest);

    /**
     * 分页查询瀑布流
     * @param picturePageQueryRequest
     * @return
     */
    PageQueryResult<WaterfallPictureVo> pageQueryWaterfall(PicturePageQueryRequest picturePageQueryRequest,UserSession userSession);

    /**
     * 分页查询空间图片
     * @param picturePageQueryRequest
     * @param userSession
     * @return
     */
    PageQueryResult<Picture> pageQuerySpacePicture(PicturePageQueryRequest picturePageQueryRequest, UserSession userSession);

    /**
     * 图片审核
     * @param pictureReviewRequest
     * @param userSession
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, UserSession userSession);

    /**
     * 以颜色搜图(仅支持在私人空间搜索)
     * @param spaceId 空间id
     * @param picColor 颜色
     * @param userSession
     * @return
     */
    List<PictureVo> searchByColor(Long spaceId, String picColor, UserSession userSession);

    /**
     * 生成透明底证件照
     * @param multipartFile 上传文件
     * @param pictureProcessRequest 参数
     * @param userSession 当前用户
     * @return
     */
    PictureProcessVo produceIdPhoto(MultipartFile multipartFile, PictureProcessRequest pictureProcessRequest, UserSession userSession);

    /**
     * 生成带颜色的证件照
     * @param color
     * @param inputImageBase64
     * @param userSession
     * @return
     */
    PictureProcessDownloadVo downloadIdPhoto(String color, String inputImageBase64, UserSession userSession);
}
